// knowledgeTree.js - 知识树路由
const express = require('express');
const router = express.Router();
const knowledgeTreeController = require('../controllers/knowledgeTreeController');

// 获取整棵知识树
router.get('/', knowledgeTreeController.getTree);

// 获取单个节点及其子节点
router.get('/:nodeId', knowledgeTreeController.getNode);

// 创建新节点
router.post('/', knowledgeTreeController.createNode);

// 更新节点信息
router.put('/:nodeId', knowledgeTreeController.updateNode);

// 移动节点（修改父节点或顺序）
router.patch('/:nodeId/move', knowledgeTreeController.moveNode);

// 删除节点
router.delete('/:nodeId', knowledgeTreeController.deleteNode);

module.exports = router; 